﻿<!--*********************************************************************

   Extended WPF Toolkit

   Copyright (C) 2010-2012 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license 

   This program can be provided to you by Xceed Software Inc. under a
   proprietary commercial license agreement for use in non-Open Source
   projects. The commercial version of Extended WPF Toolkit also includes
   priority technical support, commercial updates, and many additional 
   useful WPF controls if you license Xceed Business Suite for WPF.

   Visit http://xceed.com and follow @datagrid on Twitter.

  ********************************************************************-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Twi.COMMON.WPF.CtlExtended"
                    xmlns:conv="clr-namespace:Twi.COMMON.WPF.CtlExtended.Core.Converters">

   <conv:WizardPageButtonVisibilityConverter x:Key="WizardPageButtonVisibilityConverter" />

   <Style TargetType="{x:Type local:Wizard}">
      <Setter Property="Background" Value="#F0F0F0" />
      <Setter Property="BorderBrush" Value="#A0A0A0" />
      <Setter Property="BorderThickness" Value="1" />
      <Setter Property="ItemsPanel">
         <Setter.Value>
            <ItemsPanelTemplate>
               <Grid />
            </ItemsPanelTemplate>
         </Setter.Value>
      </Setter>
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="{x:Type local:Wizard}">
               <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                  <Grid Background="{TemplateBinding Background}">
                     <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                     </Grid.RowDefinitions>

                     <ContentPresenter Content="{Binding CurrentPage, RelativeSource={RelativeSource TemplatedParent}}" />

                     <Border Grid.Row="1" Background="#F0F0F0" BorderBrush="#A0A0A0" BorderThickness="0,1,0,0" Padding="7">
                        <StackPanel Background="{TemplateBinding Background}">
                           <Grid Margin="{TemplateBinding Padding}">
                              <Grid.ColumnDefinitions>
                                 <ColumnDefinition Width="Auto" />
                                 <ColumnDefinition Width="*" />
                              </Grid.ColumnDefinitions>
                              <Button Name="PART_HelpButton"
                                      Grid.Column="0"
                                      MinWidth="75" 
                                      Command="local:WizardCommands.Help" 
                                      Content="{TemplateBinding HelpButtonContent}">
                                 <Button.Visibility>
                                    <MultiBinding Converter="{StaticResource WizardPageButtonVisibilityConverter}">
                                       <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HelpButtonVisibility" />
                                       <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="CurrentPage.HelpButtonVisibility" />
                                    </MultiBinding>
                                 </Button.Visibility>
                              </Button>
                              <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
                                 <Button Name="PART_CancelButton"
                                         Margin="0,0,7,0"
                                         MinWidth="75" 
                                         Command="local:WizardCommands.Cancel" 
                                         Content="{TemplateBinding CancelButtonContent}">
                                    <Button.Visibility>
                                       <MultiBinding Converter="{StaticResource WizardPageButtonVisibilityConverter}">
                                          <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="CancelButtonVisibility" />
                                          <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="CurrentPage.CancelButtonVisibility" />
                                       </MultiBinding>
                                    </Button.Visibility>
                                 </Button>
                                 <Button Name="PART_BackButton"
                                         MinWidth="75" 
                                         Command="local:WizardCommands.PreviousPage" 
                                         Content="{TemplateBinding BackButtonContent}">
                                    <Button.Visibility>
                                       <MultiBinding Converter="{StaticResource WizardPageButtonVisibilityConverter}">
                                          <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="BackButtonVisibility" />
                                          <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="CurrentPage.BackButtonVisibility" />
                                       </MultiBinding>
                                    </Button.Visibility>
                                 </Button>
                                 <Button Name="PART_NextButton"
                                         MinWidth="75" 
                                         Command="local:WizardCommands.NextPage"
                                         Content="{TemplateBinding NextButtonContent}">
                                    <Button.Visibility>
                                       <MultiBinding Converter="{StaticResource WizardPageButtonVisibilityConverter}">
                                          <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="NextButtonVisibility" />
                                          <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="CurrentPage.NextButtonVisibility" />
                                       </MultiBinding>
                                    </Button.Visibility>
                                 </Button>
                                 <Button Name="PART_FinishButton"
                                         Margin="7,0,0,0"
                                         MinWidth="75" 
                                         Command="local:WizardCommands.Finish" 
                                         Content="{TemplateBinding FinishButtonContent}">
                                    <Button.Visibility>
                                       <MultiBinding Converter="{StaticResource WizardPageButtonVisibilityConverter}">
                                          <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="FinishButtonVisibility" />
                                          <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="CurrentPage.FinishButtonVisibility" />
                                       </MultiBinding>
                                    </Button.Visibility>
                                 </Button>
                              </StackPanel>
                           </Grid>
                        </StackPanel>
                     </Border>
                  </Grid>
               </Border>
            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>

   <ControlTemplate x:Key="BlankWizardPageTemplate" TargetType="{x:Type local:WizardPage}">
      <Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
         <Grid Background="{TemplateBinding Background}">
            <ContentPresenter Margin="14" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
         </Grid>
      </Border>
   </ControlTemplate>

   <ControlTemplate x:Key="ExteriorWizardPageTemplate" TargetType="{x:Type local:WizardPage}">
      <Grid Background="{TemplateBinding Background}">
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
         </Grid.ColumnDefinitions>
         <Border SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
            <Grid Grid.Column="0" Background="{TemplateBinding ExteriorPanelBackground}" MinWidth="{Binding ExteriorPanelMinWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:Wizard}}">
               <ContentControl Content="{TemplateBinding ExteriorPanelContent}" />
            </Grid>
         </Border>
         <Grid Column="1" Margin="14">
            <Grid.RowDefinitions>
               <RowDefinition Height="Auto" />
               <RowDefinition Height="Auto" />
               <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" TextWrapping="Wrap" Margin="0,0,0,14" FontSize="16" FontWeight="Bold" Text="{TemplateBinding Title}" />
            <TextBlock Grid.Row="1" TextWrapping="Wrap" Margin="0,0,0,14" Text="{TemplateBinding Description}" />
            <ContentPresenter Grid.Row="2" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
         </Grid>
      </Grid>
   </ControlTemplate>

   <ControlTemplate x:Key="InteriorWizardPageTemplate" TargetType="{x:Type local:WizardPage}">
      <Grid>
         <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
         </Grid.RowDefinitions>

         <Grid Background="{TemplateBinding HeaderBackground}" MinHeight="56">
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="*" />
               <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <StackPanel>
               <TextBlock Margin="16,9,0,1" TextWrapping="Wrap" FontWeight="Bold" Text="{TemplateBinding Title}" />
               <TextBlock Margin="32,0,0,3" TextWrapping="Wrap" Text="{TemplateBinding Description}" />
            </StackPanel>
            <Image Grid.Column="1" Margin="4" Source="{TemplateBinding HeaderImage}" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" />
         </Grid>

         <Border Grid.Row="1" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
            <Grid Background="{TemplateBinding Background}">
               <ContentPresenter Margin="14" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
            </Grid>
         </Border>
      </Grid>
   </ControlTemplate>

   <Style TargetType="{x:Type local:WizardPage}">
      <Style.Triggers>
         <Trigger Property="PageType" Value="Blank">
            <Setter Property="Background" Value="#FFF0F0F0" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="Template" Value="{StaticResource BlankWizardPageTemplate}" />
         </Trigger>
         <Trigger Property="PageType" Value="Exterior">
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="ExteriorPanelBackground" Value="#E3EFFF" />
            <Setter Property="Template" Value="{StaticResource ExteriorWizardPageTemplate}" />
         </Trigger>
         <Trigger Property="PageType" Value="Interior">
            <Setter Property="Background" Value="#FFF0F0F0" />
            <Setter Property="BorderBrush" Value="{x:Static SystemColors.ActiveBorderBrush}" />
            <Setter Property="BorderThickness" Value="0,1,0,0" />
            <Setter Property="HeaderBackground" Value="#FFFFFF" />
            <Setter Property="Template" Value="{StaticResource InteriorWizardPageTemplate}" />
         </Trigger>
      </Style.Triggers>
   </Style>

</ResourceDictionary>